import Vue from 'vue'
import Router from 'vue-router'
import home from '@/view/home'
import goods from '@/view/goods'


Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      name: '',
      component: home,
      children: [{
        path: '/',
        name: 'index',
        component: resolve => require(['@/view/index'], resolve)
      }, {
        path: 'coupon',
        name: 'coupon',
        component: resolve => require(['@/view/coupon'], resolve)
      },{
        path: 'goods',
        name: 'goods',
        component: resolve => require(['@/view/havegoods'], resolve)
      },{
        path: 'circle',
        name: 'circle',
        component: resolve => require(['@/view/circle'], resolve)
      },{
        path: 'my',
        name: 'my',
        component: resolve => require(['@/view/my'], resolve)
      }]
    },
    {
      path: '/goodsdetail',
      name: 'goodsdetails',
      component: goods
    },
    {
      path: '/myroot',
      name: 'myroot',
      component: resolve => require(['@/view/myroot'], resolve)
    },
    {
      path: '/invation',
      name: 'invation',
      component: resolve => require(['@/view/invation'], resolve)
    },
    {
      path: '/myinvate',
      name: 'myinvate',
      component: resolve => require(['@/view/invate'], resolve)
    },
    {
      path: '/order',
      name: 'order',
      component: resolve => require(['@/view/order'], resolve)
    },
    {
      path: '/income',
      name: 'income',
      component: resolve => require(['@/view/income'], resolve)
    },
    {
      path: '/collection',
      name: 'collection',
      component: resolve => require(['@/view/collection'], resolve)
    },
    {
      path: '/service',
      name: 'service',
      component: resolve => require(['@/view/service'], resolve)
    },
    {
      path: '/login',
      name: 'login',
      component: resolve => require(['@/view/login'], resolve)
    },
    {
      path: '/register',
      name: 'register',
      component: resolve => require(['@/view/register'], resolve)
    },
    {
      path: '/forget',
      name: 'forget',
      component: resolve => require(['@/view/forget'], resolve)
    },
    {
      path: '/practice',
      name: 'practice',
      component: resolve => require(['@/view/practice'], resolve)
    },
  ]
})
